package com.wnxy.sddfp.system;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@MapperScan("com.wnxy.sddfp.system.mapper")
@ComponentScan({"com.wnxy.sddfp.client.bank","com.wnxy.sddfp.common","com.wnxy.sddfp.system"})
@EnableFeignClients({"com.wnxy.sddfp.client.bank"}) // 在启动类上通过注解开启OpenFeign远程调用支持
@EnableCircuitBreaker
public class SystemApplication {
    public static void main(String[] args) {
        SpringApplication.run(SystemApplication.class, args);
    }

    //在启动类或配置类中注入负载均衡策略对象。所有服务请求均使用该策略。
//    @Bean
//    public IRule rules(){
//        return new RoundRobinRule();
//    }
}